import { reqCategoryList } from "@/api"

const state = {
    categoryList: []
}

const mutations = {
    REVICE_CATEGORYLIST(state, categoryList) {
        state.categoryList = categoryList;
    }
}

const actions = {
    async getCategoryList({ commit }) {
        let result = await reqCategoryList();
        if (result && result.code === 200) {
            commit("REVICE_CATEGORYLIST", result.data);
        }
        console.log(result)
    }
}

const getters = {

}

export default {
    state,
    mutations,
    actions,
    getters
}
